/* eslint-disable perfectionist/sort-imports */
// 全局组件
import { setupGlobCom } from '@fl/origin-components'

// 引入动画
import './plugins/animate.css'

// 引入element-plus
import { setupElementPlus } from './plugins/element-plus'

// 导入全局的svg图标
import './plugins/svgIcon'

// 引入unocss
import './plugins/unocss'

// 引入 vue-query
import { setupVueQuery } from './plugins/vue-query'

// 初始化多语言
import { setupI18n } from './plugins/vue-i18n'

// 引入 vxe-table
import { setupVxeTable } from './plugins/vxe-table'

// 引入状态管理
import { setupStore } from '@fl/store'

// 引入全局样式
import '@fl/styles/index.less'

import { createApp } from 'vue'

import 'vue/jsx'

import App from './app.vue'
import './permission'

// 路由
import { setupRouter } from './router'

// 配置无界
import { setupWujie } from './wujie'

// 通知用户刷新
import '@fl/utils/version-polling'

// 创建实例
async function setupAll() {
    const app = createApp(App)

    setupWujie(app)

    await setupI18n(app)

    setupStore(app)

    setupGlobCom(app)

    await setupElementPlus(app)

    setupVxeTable(app)

    setupRouter(app)

    setupVueQuery(app)

    app.mount('#app')
}

setupAll()
